package com.test.dababy.dababy_00_analytics.dababyhttp

import java.sql.DriverManager.println
import java.util.concurrent.BlockingQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit


class DababyHttpPoolExecutor(
    corePoolSize_dababy: Int,
    maximumPoolSize_dababy: Int,
    keepAliveTime_dababy: Long,
    unit_dababy: TimeUnit?,
    workQueue_dababy: BlockingQueue<Runnable>?
) : ThreadPoolExecutor(corePoolSize_dababy, maximumPoolSize_dababy, keepAliveTime_dababy, unit_dababy, workQueue_dababy) {

    override fun beforeExecute(t: Thread?, r: Runnable?) {
        super.beforeExecute(t, r)
        println("线程：${t?.name} 准备执行")
    }

    override fun afterExecute(r: Runnable?, t: Throwable?) {
        super.afterExecute(r, t)
        println("线程：${Thread.currentThread().name} 执行结束")
    }

    override fun terminated() {
        super.terminated()
        println("线程：结束")
    }
}